
diary 'flyfly.txt'
diary on;

X = 0:1000:50000;
Y = 0:1000:70000;
aa = length(X);
b = length(Y);
t= 0:1:360;
map =zeros(aa,b,2);
V1=82.5;
V2=100;
a=0.95;

plan=zeros(1,7*5);
M=140000;

tmin =360;
%% 开始循环过程
for L1=4000:1:4000
    for V1 =50:2:80
        for V2=50:2:80
            for a=0.3:0.1:0.5
                for y2=0:M/10:M/2
                    for y1 = M/2:M/10:M                 
                        [t,xxyy] = ode45( @(t,y)fly_the_air(t,y,L1,V1,V2,a,M),t,[0,M/2,50000,y1,50000,y2]);
                        [status ,tt] = check_status(xxyy,M);
                        if(status ==2)
                            if tt<tmin
                                tmin= tt;
                                vvv1 = V1;
                                vvv2 = V2;
                                aaa = a;
                                yyy2 = y2;
                                yyy1 = y1;
                            end
                        end
                    end
                end
            end
        end
    end
end


 



diary off;